Return to doc.sitecore.com

Inserting a field value into the title tag of the layout
Prev Next

Author: Alexander Shyba
Posted: 3/27/2006 2:37:51 PM

If you want to modify the contents of the < title/> tag in the layout dynamically and populate it with the value from the current item’s field, the following steps should be completed:
1. Create a rendering which will simply output the field value of the current item:

<sc:text field="title" />

2. Add the rendering definition inside the < title/> tag:

<title>
<sc:xslfile ID="pageTitle" runat="server" renderingid="{C954895B-655A-4C6C-8641-3B199CCDC2D9}"
path="/xsl/Page Title.xslt" />
</title>

To make it more easy, you can drop this rendering on your layout in the Layout Studio, then cut-paste it into the < title/> tag.


Prev Next